package com.cloud.drore.eboss.operation.service.impl;

import com.cloud.drore.eboos.common.base.BaseServiceImpl;
import com.cloud.drore.eboos.common.base.MyMapper;
import com.cloud.drore.eboos.common.util.DateToStringUtil;
import com.cloud.drore.eboos.common.util.LocalDateAndDateTransformUtil;

import com.cloud.drore.eboss.supplier.mapper.SupplierSettlementAutoInfoMapper;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.time.LocalDateTime;


/**
 * 浙江卓锐科技股份有限公司 版权所有 © Copyright 2018<br>
 *
 * @Description: <br>
 * @Project: eboos <br>
 * @CreateDate: Created in 2018/1/4 12:45 <br>
 * @Author: <a href="410508961@qq.com">夏凯</a>
 */
@Service
public class TimeTaskServiceImpl extends BaseServiceImpl {
    @Resource
    SupplierSettlementAutoInfoMapper supplierSettlementAutoInfoMapper;

    @Override
    public MyMapper getMapper() {
        return supplierSettlementAutoInfoMapper;
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void updateSupplierInfo(Long id) {
        supplierSettlementAutoInfoMapper.updateupdateSupplierInfo(id);
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void updateSettlementFlag() {
        String stringDateTime = DateToStringUtil.getStringDateTime(LocalDateAndDateTransformUtil.localDateTimeToDate(LocalDateTime.now()));
        supplierSettlementAutoInfoMapper.updateSettlementFlag(stringDateTime);
    }

}
